//
//  CityTableViewCell.m
//  chanyou
//
//  Created by wanli on 14/12/31.
//  Copyright (c) 2014年 wanli. All rights reserved.
//


#import "CityTableViewCell.h"
#import "Masonry.h"
#define SCREEN_WIDTH ([UIScreen mainScreen].bounds.size.width)
#define SCREEN_HEIGHT ([UIScreen mainScreen].bounds.size.height)
@implementation CityTableViewCell

- (void)dealloc
{
    [_name release];
    [_view release];
    [_dissertation release];
    [_travel release];
    [_notes release];
    [_journey release];
    [super dealloc];
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        self.view = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, SCREEN_HEIGHT / 3)];
        [self.contentView addSubview:_view];
        [_view release];
        
        self.name = [[UILabel alloc] initWithFrame:CGRectMake(10, 10, 200, 30)];
        _name.highlightedTextColor = [UIColor whiteColor];
        _name.font = [UIFont systemFontOfSize:20];
        [_name setTextColor:[UIColor whiteColor]];
        [self.contentView addSubview:_name];
        [_name release];
        
        self.dissertation = [[UIButton alloc] initWithFrame:CGRectMake(SCREEN_WIDTH / 8 - 20, SCREEN_HEIGHT / 3, 50, 50)];
        //        _dissertation.
        UIImageView *disImage = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"专题.png"]];
        disImage.frame =  CGRectMake(0, 0, 40, 40);
        UILabel *disLab = [[UILabel alloc] initWithFrame:CGRectMake(5, 35, 50, 30)];
        disLab.text = @"专题";
        disLab.font = [UIFont systemFontOfSize:14];
        //        [disImage addSubview:disLab];
        [_dissertation addSubview:disImage];
        [_dissertation addSubview:disLab];
        [disLab release];
        [disImage release];
        [self.contentView addSubview:_dissertation];
        [_dissertation release];
        
        self.journey = [[UIButton alloc] initWithFrame:CGRectMake(SCREEN_WIDTH / 8 * 3 - 20, SCREEN_HEIGHT / 3, 50, 50)];
        
        UIImageView *jouImage = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"行程.png"]];
        jouImage.frame =  CGRectMake(0, 0, 40, 40);
        UILabel *jouLab = [[UILabel alloc] initWithFrame:CGRectMake(5, 35, 50, 30)];
        jouLab.text = @"行程";
        jouLab.font = [UIFont systemFontOfSize:14];
        //        [disImage addSubview:disLab];
        [_journey addSubview:jouImage];
        [_journey addSubview:jouLab];
        [jouLab release];
        [jouImage release];
        
        [self.contentView addSubview:_journey];
        [_journey release];
        
        self.travel = [[UIButton alloc] initWithFrame:CGRectMake(SCREEN_WIDTH / 8 * 5 - 20, SCREEN_HEIGHT / 3, 50, 50)];
        
        UIImageView *traImage = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"旅行地.png"]];
        traImage.frame =  CGRectMake(0, 0, 40, 40);
        UILabel *traLab = [[UILabel alloc] initWithFrame:CGRectMake(5, 35, 50, 30)];
        traLab.text = @"旅行地";
        traLab.font = [UIFont systemFontOfSize:14];
        //        [disImage addSubview:disLab];
        [_travel addSubview:traImage];
        [_travel addSubview:traLab];
        [traLab release];
        [traImage release];
        [self.contentView addSubview:_travel];
        [_travel release];
        
        self.notes = [[UIButton alloc] initWithFrame:CGRectMake(SCREEN_WIDTH / 8 * 7 - 20, SCREEN_HEIGHT / 3, 50, 50)];
        UIImageView *noteImage = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"游记.png"]];
        noteImage.frame =  CGRectMake(0, 0, 40, 40);
        UILabel *noteLab = [[UILabel alloc] initWithFrame:CGRectMake(5, 35, 50, 30)];
        noteLab.text = @"游记";
        noteLab.font = [UIFont systemFontOfSize:14];
        //        [disImage addSubview:disLab];
        [_notes addSubview:noteImage];
        [_notes addSubview:noteLab];
        [noteLab release];
        [noteImage release];
        
        [self.contentView addSubview:_notes];
        [_notes release];
    }
    return self;
}


- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
